using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using MCWEBSITE.ENTITY;
using MCWEBSITE.BUL;

public partial class Modules_HugKid_wucProductListByCat : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        int productCatID;
        if (Request.QueryString["ProductCat"] != null)
        {
            productCatID = Convert.ToInt32(Request.QueryString["ProductId"].ToString());
            BindProductListByCat(productCatID);
        }
    }

    protected void BindProductListByCat(int ProductCat) {
        websiteProductCategoryInfo objProductCat = websiteProductCategoryBUL.Load(ProductCat);
        lbProductCatName.Text = objProductCat.CategoryName;
        if (objProductCat.ParentCategoryID != 0)
        {
            dlProductListByCat.DataSource = websiteProductBUL.GetByLanguageAndCategoryDS(ProductCat, "1", "vi-VN");
            dlProductListByCat.DataBind();
        }
        else {
            dlProductListByCat.DataSource = websiteProductBUL.GetByLanguageAndCategory(ProductCat, "1", "vi-VN");
            dlProductListByCat.DataBind();
        }        
    }
}
